package com.ttnet.model.enumerations;

import org.apache.log4j.Logger;

public enum OperationResultCode {
	UNDEFINED, SUCCESSFUL, UNSUCCESSFUL;

	private static final Logger LOG = Logger.getLogger(OperationResultCode.class);

	private OperationResultCode() {
	}

	public static OperationResultCode get(int ordinal) {
		OperationResultCode[] values = OperationResultCode.values();
		for (OperationResultCode role : values) {
			if (role.ordinal() == ordinal) {
				return role;
			}
		}

		LOG.warn("Enum not found: ordinal=" + ordinal);

		return null;
	}

	public String getName() {
		return this.name();
	}
}
